From: Jasper St. Pierre Date: Fri, 15 Feb 2013 02:21:20 +0000 (-0500) Subject: layout: Fix old event removal X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4844 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=001bbd36f55f8f097b9fe7f72e7b7b1fc931f3c5;p=gnome-shell.git layout: Fix old event removal If we increment our index variable while looping, this means that firstNewEvent will be one higher than it should. With a length 1 array, all events will be removed, so this has a cascading effect that events will not be stored at all. https://bugzilla.gnome.org/show_bug.cgi?id=693854 --- diff --git a/js/ui/layout.js b/js/ui/layout.js index 26d239328..cae7f8187 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -1176,8 +1176,9 @@ const PressureBarrier = new Lang.Class({ // and then chop events after that off. let i = 0; while (i < this._barrierEvents.length) { - if (!this._isBarrierEventTooOld(this._barrierEvents[i++])) + if (!this._isBarrierEventTooOld(this._barrierEvents[i])) break; + i++; } let firstNewEvent = i;